package cn.tedu.mall.seckill.exception;

import cn.tedu.mall.common.restful.JsonResult;
import cn.tedu.mall.common.restful.ResponseCode;
import cn.tedu.mall.pojo.seckill.dto.SeckillOrderAddDTO;
import com.alibaba.csp.sentinel.slots.block.BlockException;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class SeckillFallbackError {
    //不添加static，无法被sentinel管理到
    //在参数列表中还可以额外添加一个Throwable异常
    public static JsonResult fallbackError(String randCode, SeckillOrderAddDTO seckillOrderAddDTO){
        log.info("一个请求被降级了");
        return JsonResult.failed(ResponseCode.INTERNAL_SERVER_ERROR,"服务器内部异常，请联系客服");
    }
}
